package rdd01.text

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

object RDD_Text_Read {
  //RDD文件读取
  def main(args: Array[String]): Unit = {
    val sparkconf=new SparkConf().setMaster("local[*]").setAppName("persis")
    val sc=new SparkContext(sparkconf)
    val out1: RDD[String] = sc.textFile("out1")
    println(out1.collect().mkString(","))
    val out2: RDD[(String, Int)] = sc.objectFile[(String, Int)]("out2")
    println(out2.collect().mkString(">>"))
  val out3 = sc.sequenceFile[String,Int]("out3")
    println(out3.collect().mkString(","))
    sc.stop()

  }

}
